package xproto

import "errors"

var (
	ErrNo            = errors.New("success")         //
	ErrTimeout       = errors.New("timeout")         // 超时
	ErrParam         = errors.New("parameter error") // 参数错误
	ErrNoResult      = errors.New("no result")       // 结果错误
	ErrObjectExist   = errors.New("already exists")  // 链接已存在
	ErrObjectNoExist = errors.New("doesn't exist")   // 链接不存在
	ErrInvalidDevice = errors.New("invalid device")
	ErrUnSupport     = errors.New("unsupport")
	ErrRecvOver      = errors.New("data over")
)

const (
	NetUnknow = iota //  未知
	NetCable         //  有线
	NetWifi          //  Wifi
	Net2G            //  2G
	Net3G            //  3G
	Net4G            //  4G
	Net5G            //  5G
)

const (
	LinkUnknow       = iota //  未知
	LinkSignal              //  信令
	LinkInteractive         //  交互链路（文件查询等）
	LinkQuery               //  查询链路
	LinkLiveStream          //  实时预览
	LinkPlayback            //  回放
	LinkFileTransfer        //  文件传输
	LinkSerial              //  串口透传
	LinkVoice               //  语音
)

const (
	FileUnknow      = iota
	FileNormalVideo // 录像
	FileAlarmVideo  // 报警录像
	FileNormalPic   // 照片
	FileAlarmPic    // 报警照片
	FileUpgrade     // 升级文件
	FileLog         // 日志文件
	FileConfigure   // 配置文件
	FileBlackBox    // 黑匣子文件
	FileNormalVoice // 正常声音
	FileAlarmVoice  // 报警声音
	FileEvidence    // 报警关联文件
)

const (
	FrameInvalid = iota //  无效
	FrameVideoI         //  视频I帧
	FrameVideoP         //  视频P帧
	FrameAudio          //  hisi g726音频帧
	FrameRawData        //  透传数据,原始数据
	FrameFile           //  文件数据帧
	FrameStatus         //  状态数据
	FrameAAC
)

// 动作类型
const (
	ActDownload = iota // 从设备下载文件
	ActUpload          // 上传文件到设备
)

// 报警类型
const (
	AlrUnknow                  = 0x00 //未知   //unknow
	AlrVideoLost               = 0x01 //视频丢失   //video lost
	AlrMotionDetection         = 0x02 //移动侦测   //motion detection
	AlrVideoMask               = 0x03 //视频遮挡   //video blind
	AlrInputGenerate           = 0x04 //输入触发   //input trigger
	AlrUrgency                 = 0x05 //紧急告警   //emmergencyAlr
	AlrLowSpeed                = 0x06 //低速告警   //low speedAlr
	AlrOverSpeed               = 0x07 //超速告警   //overspeedAlr
	AlrLowTemperature          = 0x08 //低温告警   //low temperatureAlr
	AlrOverTemperature         = 0x09 //高温告警   //high temperatureAlr
	AlrHumidity                = 0x0a //湿度告警   //humidityAlr
	AlrParkTimeout             = 0x0b //超时停车   //park timeoutAlr
	AlrShake                   = 0x0c //震动告警   //vibrationAlr
	AlrGeofence                = 0x0d //电子围栏   //electronic defence
	AlrGeoLine                 = 0x0e //电子线路   //electronic line
	AlrDoorException           = 0x0f //异常开关门   //door open/ close exception
	AlrStorageException        = 0x10 //存储介质异常   //storage exception
	AlrFatigueDriving          = 0x11 //疲劳驾驶   //fatigue driving
	AlrFuelException           = 0x12 //油量异常   //fuel exception
	AlrIllegalFire             = 0x13 //非法点火   //illegal ACC
	AlrLocationModuleException = 0x14 //定位模块异常   //location module exception
	AlrFrontPanelPrise         = 0x15 //前面板打开   //front panel prise
	AlrSwipeCard               = 0x16 //刷卡		//swipe card
	AlrSwipeIbutton            = 0x17 //IBUTTON	//ibutton
	AlrHarshAcceleration       = 0x18 //急加速
	AlrHarshBraking            = 0x19 //急减速
	AlrLowSpeedWarn            = 0x1a //低速预警	26
	AlrOverSpeedWarn           = 0x1b //高速预警
	AlrVoltageWarn             = 0x1c //电压告警
	AlrPeopleCounting          = 0x1d //人数统计
	AlrDmsOrAdas               = 0x1e //dms和adas报警（主动安全）
	AlrAccOn                   = 0x1f //acc on
	AlrSpeedIdle               = 0x20 //怠速告警
	AlrGpsAntennaOpen          = 0x21 //Gps天线开路
	AlrGpsAntennaCircuit       = 0x22 //Gps天线短路
	AlrIoOutput                = 0x23 //IO输出
	AlrCanbusException         = 0x24 //CANBus连接异常
	AlrTtrailer                = 0x25 //拖车
	AlrGlide                   = 0x26 //空挡滑行
	AlrRpmHigh                 = 0x27 //转速过高
	AlrVehicleMovement         = 0x28 //车辆移动
	AlrTripStart               = 0x29 //行程开始
	AlrTripDuring              = 0x2A //行程中
	AlrTripEnd                 = 0x2B //行程结束
	AlrLocateRecovery          = 0x2C //定位恢复
	AlrVideoAnomaly            = 0x2D //视频异常
	AlrNoneTripPositon         = 0x2E //视频异常
	AlrDisconnectServer        = 0x2F //断开连接
	AlrHsOver                  = 0x30 //高速公路超速
	AlrLoad                    = 0x31 //载重告警
)

const (
	EvtTrip         = iota + 0x300 //行程
	EvtTpm                         //胎压
	EvtDiskDet                     //磁盘检测
	EvtUpgrade      = iota + 0x3ff //升级通知
	EvtFileTransfer                //文件传输
	EvtFile         = iota + 0x500 //文件
	EvtFileCapture                 //定时抓拍
	EvtFileLittle                  //小视频文件
	EvtFtpTransfer                 //ftp文件传输
)
